package terra.network.packet.server.battle;

import org.jboss.netty.buffer.ChannelBuffer;

import terra.network.packet.Packet;

public class Blow extends Packet {

	public int x;
	public int y;
	public int r,g,b;
	public int radius, time;
	
	@Override
	public ChannelBuffer toBuffer() {
		ChannelBuffer buf = getNewBuffer();
		buf.writeByte(getId());
		buf.writeInt(x);
		buf.writeInt(y);
		buf.writeInt(r);
		buf.writeInt(g);
		buf.writeInt(b);
		buf.writeInt(radius);
		buf.writeInt(time);
		return buf;
	}

	@Override
	public Packet fromBuffer(ChannelBuffer buf) {
		x = buf.readInt();
		y = buf.readInt();
		r = buf.readInt();
		g = buf.readInt();
		b = buf.readInt();
		radius = buf.readInt();
		time = buf.readInt();
		return this;
	}

	@Override
	public int getLength() {
		return 29;
	}

	@Override
	public boolean isDynamicLength() {
		return false;
	}

	@Override
	public byte getId() {
		return 31;
	}
	
	@Override
	public byte getPriority() {
		return PRIOR_HIGH;
	}

}
